from twitter import *
import os

try:
    content = raw_input('Please Enter your tweet:')
except:
    print 'Format is not correct'
    content = "I love #Python"

print content

MY_TWITTER_CREDS = os.path.expanduser(r'my_app_credentials')
CONSUMER_KEY = ""
CONSUMER_SECRET = ""

if not os.path.exists(MY_TWITTER_CREDS):
    oauth_dance("Dynamsoft Twitter Controller", CONSUMER_KEY, CONSUMER_SECRET, MY_TWITTER_CREDS)

oauth_token, oauth_secret = read_token_file(MY_TWITTER_CREDS)

twitter_obj = Twitter(auth=OAuth(
    oauth_token, oauth_secret, CONSUMER_KEY, CONSUMER_SECRET))

twitter_obj.statuses.update(status=content)
